package cn.xxstudy.visitshop.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import cn.xxstudy.visitshop.R
import cn.xxstudy.visitshop.base.adapter.BaseAdapter
import cn.xxstudy.visitshop.network.data.InfoData

/**
 * @author ：DELL on 2021/3/24 .
 * @packages ：cn.xxstudy.visitshop.adapter .
 * TODO:资讯适配器
 */
class InfoAdapter : BaseAdapter<InfoData, InfoAdapter.TaskViewHolder>() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TaskViewHolder {
        val rootView =
            LayoutInflater.from(parent.context).inflate(R.layout.item_normal, parent, false)
        return TaskViewHolder(rootView)
    }

    override fun onBindViewHolder(holder: TaskViewHolder, position: Int) {
        super.onBindViewHolder(holder, position)
        holder.title.text = datas[position].title
    }

    inner class TaskViewHolder(rootView: View) : RecyclerView.ViewHolder(rootView) {
        val title = rootView.findViewById<TextView>(R.id.toolbarTitle)
    }
}